import 'package:flutter/widgets.dart';
import 'package:vc_package/widget/visible_view.dart';
import '../utils/base_color_utils.dart';

class LineView extends StatefulWidget {
  final bool? visible;
  final EdgeInsets? margin;
  final EdgeInsets? padding;
  final double? height;
  final double? width;
  final Color? color;
  final double? radius;

  const LineView(
      {Key? key,
        this.visible,
        this.margin,
        this.padding,
        this.height,
        this.width,
        this.color,
        this.radius})
      : super(key: key);

  @override
  LineViewState createState() => LineViewState();
}

class LineViewState extends State<LineView> {
  @override
  Widget build(BuildContext context) {
    return VisibleView(
      visible: widget.visible ?? true,
      child: Container(
        margin: widget.margin,
        padding: widget.padding,
        width: widget.width ?? double.infinity,
        height: widget.height ?? .5,
        decoration: BoxDecoration(
            color: widget.color ?? ColorUtils.line,
            borderRadius:
            BorderRadius.all(Radius.circular(widget.radius ?? 0))),
      ),
    );
  }
}